package com.cam.generator.dict;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public enum GenVersion {
    CAM1X("cam", "1x", new ArrayList<Map<String, String>>(){{
        add(new HashMap<String, String>(){{
            put("categoryPath", "{javaCategory}/pojo/entity/{entityName}Entity.java");
            put("templatePath", "vms/cam/1x/entity.vm");
        }});
        add(new HashMap<String, String>(){{
            put("categoryPath", "{javaCategory}/pojo/dto/{entityName}DTO.java");
            put("templatePath", "vms/cam/1x/dto.vm");
        }});
        add(new HashMap<String, String>(){{
            put("categoryPath", "{javaCategory}/pojo/wrapper/{entityName}Wrapper.java");
            put("templatePath", "vms/cam/1x/wrapper.vm");
        }});
        add(new HashMap<String, String>(){{
            put("categoryPath", "{javaCategory}/mapper/xml/{entityName}Mapper.xml");
            put("templatePath", "vms/cam/1x/mapper.xml.vm");
        }});
        add(new HashMap<String, String>(){{
            put("categoryPath", "{javaCategory}/mapper/{entityName}Mapper.java");
            put("templatePath", "vms/cam/1x/mapper.vm");
        }});
        add(new HashMap<String, String>(){{
            put("categoryPath", "{javaCategory}/service/{entityName}Service.java");
            put("templatePath", "vms/cam/1x/service.vm");
        }});
        add(new HashMap<String, String>(){{
            put("categoryPath", "{javaCategory}/controller/{entityName}Controller.java");
            put("templatePath", "vms/cam/1x/controller.vm");
        }});
        add(new HashMap<String, String>(){{
            put("categoryPath", "{webCategory}/{entityName}List.vue");
            put("templatePath", "vms/cam/1x/list.vm");
        }});
        add(new HashMap<String, String>(){{
            put("categoryPath", "{webCategory}/{entityName}Form.vue");
            put("templatePath", "vms/cam/1x/form.vm");
        }});
        add(new HashMap<String, String>(){{
            put("categoryPath", "{webCategory}/{entityName}Api.js");
            put("templatePath", "vms/cam/1x/api.js.vm");
        }});
        add(new HashMap<String, String>(){{
            put("categoryPath", "sql/table.sql");
            put("templatePath", "vms/cam/1x/table.sql.vm");
        }});
        add(new HashMap<String, String>(){{
            put("categoryPath", "sql/menu.sql");
            put("templatePath", "vms/cam/1x/menu.sql.vm");
        }});
    }}),
    IOT1X("iot", "1x", new ArrayList<Map<String, String>>(){{
        add(new HashMap<String, String>(){{
            put("categoryPath", "{javaCategory}/pojo/entity/{entityName}.java");
            put("templatePath", "vms/cam/1x/entity.vm");
        }});
        add(new HashMap<String, String>(){{
            put("categoryPath", "{javaCategory}/pojo/dto/{entityName}DTO.java");
            put("templatePath", "vms/cam/1x/dto.vm");
        }});
        add(new HashMap<String, String>(){{
            put("categoryPath", "{javaCategory}/pojo/wrapper/{entityName}Wrapper.java");
            put("templatePath", "vms/cam/1x/wrapper.vm");
        }});
        add(new HashMap<String, String>(){{
            put("categoryPath", "{javaCategory}/mapper/xml/{entityName}Mapper.xml");
            put("templatePath", "vms/cam/1x/mapper.xml.vm");
        }});
        add(new HashMap<String, String>(){{
            put("categoryPath", "{javaCategory}/mapper/{entityName}Mapper.java");
            put("templatePath", "vms/cam/1x/mapper.vm");
        }});
        add(new HashMap<String, String>(){{
            put("categoryPath", "{javaCategory}/service/{entityName}Service.java");
            put("templatePath", "vms/iot/1x/service.vm");
        }});
        add(new HashMap<String, String>(){{
            put("categoryPath", "{javaCategory}/controller/{entityName}Controller.java");
            put("templatePath", "vms/iot/1x/controller.vm");
        }});
        add(new HashMap<String, String>(){{
            put("categoryPath", "{webCategory}/{entityName}List.vue");
            put("templatePath", "vms/iot/1x/list.vm");
        }});
        add(new HashMap<String, String>(){{
            put("categoryPath", "{webCategory}/{entityName}Form.vue");
            put("templatePath", "vms/iot/1x/form.vm");
        }});
        add(new HashMap<String, String>(){{
            put("categoryPath", "{webCategory}/{entityName}Api.js");
            put("templatePath", "vms/iot/1x/api.js.vm");
        }});
        add(new HashMap<String, String>(){{
            put("categoryPath", "sql/table.sql");
            put("templatePath", "vms/cam/1x/table.sql.vm");
        }});
        add(new HashMap<String, String>(){{
            put("categoryPath", "sql/menu.sql");
            put("templatePath", "vms/cam/1x/menu.sql.vm");
        }});
    }}),
    ;

    private final String platform;

    private final String version;

    private final List<Map<String, String>> templateList;


    GenVersion(String platform, String version, List<Map<String, String>> templateList) {
        this.platform = platform;
        this.version = version;
        this.templateList = templateList;
    }

    public String getPlatform() {
        return platform;
    }

    public String getVersion() {
        return version;
    }

    public List<Map<String, String>> getTemplateList() {
        return templateList;
    }
}
